package com.bjsc.mapper;

import com.baomidou.mybatisplus.plugins.Page;
import com.bjsc.entity.model.BetRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author create by VIC.Huang
 * @date 2018/3/4
 */
@Mapper
public interface DataMapper {
    @Select("select tu.id playerId, tu.nick_name playerName, t.db_game_title gameTitle, t.bet_num betNum, " +
            " t.amount, t.per_price perPrice, t.order_no orderNo," +
            " t.issue_no issueNo, t.open_code openCode, t.win_status winStatus, t.win_price winPrice, t.create_time createTime" +
            " from t_db_bet_detail t join t_user tu on t.user_id = tu.id" +
            " order by t.id desc")
    List<BetRecord> selectBetRecords(Page<Map<Object, Object>> page);

    @Select("select issue_no issueNo, open_code openCode, open_result_desc openResult, finish_flag finishFlag, " +
            " open_time openTime, create_time createTime, update_time updateTime from t_db_open_record order by id desc")
    List<Map<Object,Object>> selectOpenRecords(Page<Map<Object, Object>> page);
}
